﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <script src="/Scripts/jquery-3.3.1.min.js"></script>
    <script src="~/Scripts/jquery.cookie-1.4.1.min.js"></script>
    <script src="/Scripts/jquery.signalR-2.2.2.js"></script>
    <script src="/signalr/hubs" type="text/javascript"></script>
</head>
<body>
    <button id="btn1">click</button>
    <script>
          
        $.connection.hub.start().done(function () {
            alert("done");
        }).fail(function () {
            alert("fail");
        });

        $("#btn1").click(function () {
            var token = $.cookie("singnalrSessionId");

            $.connection.user2Hub.server.getUserName(token).done(function (msg) {
                alert(msg);
            }).fail(function (msg) {
                alert(msg);
                });
        });

    </script>
</body>
</html>
